package com.gsx.service.impl;

import com.gsx.bean.User;
import com.gsx.dao.UserMapper;
import com.gsx.service.UserService;
import com.gsx.utils.MD5Utils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description TODO
 * @Authoe gsx
 * @Date 2021/04/02 下午 2:57
 **/
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;
    @Override
    public List<User> getUserAll() {
        return null;
    }

    @Override
    public User getUserByNameAndPassword(String name, String password) {
        User user = userMapper.selectByName(name);
        if (user!=null){
            if (MD5Utils.md5(password).equals(user.getUserPassword())){
                return  user;
            }
        }
        return null;
    }
}
